package com.tjl.freme.action;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import com.tjl.frame.entity.Authority;
import com.tjl.freme.service.AuthorityService;
@org.springframework.stereotype.Controller("ReLoginAction")
public class ReLoginAction implements Controller {

	private String userName;
	
	@Autowired
	private AuthorityService service;
	@RequestMapping("relogin.do")
	@Override
	public ModelAndView handleRequest(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		// TODO Auto-generated method stub
		List<Authority> list = null;
		try {
			list=service.findAll();
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		
		Map<String,Object> map = new HashMap<String, Object>();
		map.put("list", list);
		return new ModelAndView("welcome",map);
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

}
